#include "dictData.h"
#include "cocos2d.h"
#include "../../dev/utils/CsvReader.h"
#include "../../dev/utils/Utils.h"
USING_NS_CC;

static DictData lenguageData ;
DictData* DictData::shareConfData()
{ 
	return &lenguageData;
}

DictData::~DictData()
{
	CC_SAFE_DELETE(dictData);
}

DictData::DictData()
: dictData(NULL)
{

}

Value* DictData::getDictData()
{
	if(!dictData) {
		dictData = arrayToMapping("conf/dict_conf.csv");
	}
	return dictData;
}

string DictData::getValue( const char* key )
{
	Value jsonValue = getDictData()->get(key, NULL);
	if(jsonValue == NULL) {
		return "";
	}
	string value = jsonValue["value"].asString();
	return value;
}


